package wifiunion.com.notice.presenter;

import android.content.Context;


import java.util.HashMap;

import wifiunion.com.notice.NoticeContact;
import wifiunion.com.notice.NoticeModel;

/**
 * 获取通知对象所有分组
 */

public class NoticeRelTargetGroupListPresenter implements NoticeContact.Presenter, NoticeContact.Callback {

    private NoticeContact.View mView;
    private Context mContext;
    private NoticeModel mModel;


    public NoticeRelTargetGroupListPresenter(Context context, NoticeContact.View view) {
        mView = view;
        mContext = context;
        mModel = new NoticeModel();
        mView.setPresenter(this);
    }

    @Override
    public void onSuccess(Object data) {


        mView.onGetNoticeTargetRelGroupListSuccess(data);
    }

    @Override
    public void onServerFailed(Object errorObj) {
        mView.onError(errorObj);
    }

    @Override
    public void onNetFailed() {
        mView.onError("网络异常");
    }

    @Override
    public void start() {
//        HashMap<String, Object> params = new HashMap<>();
//        params.put("Authorization", SharedPreferencesUtils.getSharedPreferences(Constants.CONFIG_AUTHTOKEN, mContext));
//        mModel.loadData(Constants.HTTP_URL_GET_RLDEVICEGROUPLIST, params, this);
    }

    @Override
    public void start(HashMap<String, Object> param1s) {
//        mModel.loadData(Constants.HTTP_URL_GET_NOTICERLDEVICEGROUPLIST, param1s, this);
    }
    //获取通知对象所以分组
    public void getTargetRelGroupList(HashMap<String, Object> param1s)
    {
        mModel.getTargetRelGroupList(param1s, this);
    }

}

